package com.lagou.rpc.core;

import com.alibaba.fastjson.JSON;

import java.util.Date;

/**
 * 服务者节点
 */
public class ProviderNode {

    /**
     * 节点消息
     */
    private String nodeUrl;

    /**
     * 请求时间
     */
    private Date requestTime;

    /**
     * 请求时长
     */
    private Long time;


    /**
     * 服务者地址
     */
    private String providerUrl;


    public String getNodeUrl() {
        return nodeUrl;
    }

    public void setNodeUrl(String nodeUrl) {
        this.nodeUrl = nodeUrl;
    }

    public Date getRequestTime() {
        return requestTime;
    }

    public void setRequestTime(Date requestTime) {
        this.requestTime = requestTime;
    }

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }

    public String getProviderUrl() {
        return providerUrl;
    }

    public void setProviderUrl(String providerUrl) {
        this.providerUrl = providerUrl;
    }

    public String toJson(){
        String providerNodeJson =  JSON.toJSONString(this);
        return providerNodeJson;
    }
}
